<template>
	<view>
		<navbar left-text="返回" titleText="物料登记" />
		<rform :form-data="formData" :params-no="paramsNo"/>
	</view>
</template>
<script>
	import navbar from '@/components/navbar.vue'
	import Rform from './components/rf-form.vue'
	import { searchForm, itemForm } from './config/form.js'
	export default {
		data() {
			return {
				formData: {
					searchForm: searchForm,
					itemForm: itemForm
				},
				swiperHeight: '',
				paramsNo: ''
			};
		},
		components: {
			navbar,
			Rform
		},
		onLoad(args) {
			if (args.purchaseNo) {
				this.paramsNo = args.purchaseNo
			}
		  },
		methods: {
			//动态设置swiper的高度
			setSwiperHeight() {
				let query = uni.createSelectorQuery().in(this);
				query.select('.form-swiper').boundingClientRect();
				query.exec((res) => {
					if (res && res[0]) {
						this.swiperHeight = res[0].height;
					}
				});
			},
		}
	}
</script>

<style lang="scss">

</style>
